<template>
    <div>
      <h1>用户列表</h1>
      <ul>
        <li v-for="user in users" :key="user.id">
          <router-link :to="{ name: 'UserDetail', params: { id: user.id } }">
            {{ user.name }}
          </router-link>
        </li>
      </ul>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        users: [
          { id: 1, name: '用户1' },
          { id: 2, name: '用户2' },
          { id: 3, name: '用户3' },
        ]
      };
    }
  };
  </script>
  